package com.automannn.springPractice.zStudy;

import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;

import java.util.HashMap;
import java.util.Map;

/**.
 * 通过代码了解环境的使用
 * @author weave
 * @since 2024-06-17 16:29
 */
public class EnvironmentStudyTest {
    public static void main(String[] args) {

        /*
            学习PropertySource，环境的使用可以看springboot如何输出yml中的信息，这里暂时不增加这部分内容
         */
        Map<String, Object> source = new HashMap<>();
        source.put("name", "三友的java日记");

        PropertySource<Map<String, Object>> propertySource = new MapPropertySource("myPropertySource", source);

        Object name = propertySource.getProperty("name");

        System.out.println("name = " + name);
    }
}
